package com.example.siyun.service.impl.permissionsserviceimpl;

import com.example.siyun.mapper.permissionsmapper.ManagerlistbanlogMapper;
import com.example.siyun.pojo.ManagerListBanLog;
import com.example.siyun.service.permissionsservice.ManagerlistbanlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * @Auther: 全
 * @Date: 2022/9/26 09:33
 * @Description:权限管理模块管理员登录的日志
 */
@Service
public class ManagerlistbanlogServiceImpl implements ManagerlistbanlogService {
    @Autowired
    private ManagerlistbanlogMapper managerlistbanlogMapper;
    /**
     * 添加管理人员登录日志
     * @param managerlistbanlog 要添加的数据
     */
    @Transactional
    @Override
    public void addManagerListBanLog(ManagerListBanLog managerlistbanlog) {
        managerlistbanlogMapper.addManagerListBanLog(managerlistbanlog);
    }
    /**
     * 获取管理人员封停日志
     * @return 返回管理人员封停日志
     */
    @Transactional
    @Override
    public List<ManagerListBanLog> getManagerListBanLog(ManagerListBanLog managerlistbanlog,int isdel) {
        return managerlistbanlogMapper.getManagerListBanLog(managerlistbanlog,isdel);
    }
    /**
     * 添加封停天数
     * @param  name 要封停人得名字 bannum要封停的天数
     */
    @Transactional
    @Override
    public void addBanNum(String name, int bannum) {
        managerlistbanlogMapper.addBanNum(name,bannum);
    }
    /**
     * 设置状态通过姓名
     */
    @Transactional
    @Override
    public void setState(String name,int state) {
        managerlistbanlogMapper.setState(name,state);
    }
    /**
     * 通过id删除对应的封停日志
     * @return id要删除的封停日志
     */
    @Transactional
    @Override
    public void delListBan(int id,int isdel) {
        managerlistbanlogMapper.delListBan(id,isdel);
    }
}
